﻿Public Class Admin_Password



    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        IfAdminPSok = False
        If TextBox1.Text = "CADteam8081" And TextBox2.Text <> "" Then
            IfAdminPSok = True
            strProjectCode = TextBox2.Text
            If ConnToCPMS() Then
            Else
                MessageBox.Show("Something Wrong!")
                Exit Sub
            End If
        Else
            MessageBox.Show("Password Wrong!")
        End If
        Me.TextBox1.Text = ""

    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        For i = 0 To Me.TreeView1.Nodes.Count - 1
            PBSList.Item(i).IsChecked = Me.TreeView1.Nodes(i).Checked
        Next
        Dim PBSs = PBSList.Where(Function(x) x.IsChecked = True).ToList
        If PBSs.Count > 0 Then
            If GetGroupFromCPMS(PBSs) Then
                AccessRightAssignFromCMPS(PBSs)
            End If
        End If




    End Sub

End Class